//Эта программа генерирует функции и их сложности
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <pthread.h>
#include <unistd.h>



using namespace std;

#include "binfile.h"
#include "timeelapsed.h"
#include "g6.h"

ofstream output("f6_etalon.txt", ios_base::app);

void* mapComp_thread(void* arg) {
  Int64 f = ((Int64)rand()<<32) + rand();
  Int8 fc = g6(f);
  output << f << ' ' << (int)fc << endl;
  cout << hex << f << ' ' << dec << (int)fc << endl;  
}

void* mapComp_thread_runner(void* arg) {
  char c;
  while(true) {
    pthread_t thread;
    pthread_create(&thread, NULL, mapComp_thread, NULL);
    pthread_join(thread, NULL);
  }
}

int main() {
  srand(time(NULL));
  pthread_t thread1, thread2;
  pthread_create(&thread1, NULL, mapComp_thread_runner, NULL);
  pthread_create(&thread2, NULL, mapComp_thread_runner, NULL);
  pthread_join(thread1, NULL);
  pthread_join(thread2, NULL);
  
  output.close(); 
    
  return 0;
}
